﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace PJRScrum
{
    public partial class NextPreviousPanel : UserControl
    {
        public NextPreviousPanel()
        {
            InitializeComponent();
            buttonNext.Click += new EventHandler(buttonNext_Click);
            buttonBack.Click += new EventHandler(buttonBack_Click);
            buttonCancel.Click += new EventHandler(buttonCancel_Click);
        }

        void buttonCancel_Click(object sender, EventArgs e)
        {
            if (Cancel != null)
                Cancel(this, e);
        }

        void buttonBack_Click(object sender, EventArgs e)
        {
            if (Previous != null)
                Previous(this, e);
        }

        void buttonNext_Click(object sender, EventArgs e)
        {
            if (Next != null)
                Next(this, e);
        }

        public Button BtnNext { get { return buttonNext; } set { buttonNext = value; } }
        public Button BtnPrevious { get { return buttonBack; } set { buttonBack = value; } }
        public Button BtnCancel { get { return buttonCancel; } set { buttonCancel = value; } }

        public event EventHandler Next;
        public event EventHandler Previous;
        public event EventHandler Cancel;

        public bool NextEnabled { get { return buttonBack.Enabled; } set { buttonBack.Enabled = value; } }
        public bool PreviousEnabled { get { return buttonBack.Enabled; } set { buttonBack.Enabled = value; } }
        public bool CancelEnabled { get { return buttonBack.Enabled; } set { buttonBack.Enabled = value; } }
    }
}
